{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a517d462",
   "metadata": {},
   "outputs": [],
   "source": [
    "#1 根据可信度筛选有效数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8c0c301d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>88150.776780</td>\n",
       "      <td>0</td>\n",
       "      <td>0.828006</td>\n",
       "      <td>0.531433</td>\n",
       "      <td>0.397509</td>\n",
       "      <td>88150.77678-0</td>\n",
       "      <td>28.369753</td>\n",
       "      <td>52.033135</td>\n",
       "      <td>705.121116</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.011527</td>\n",
       "      <td>0.051002</td>\n",
       "      <td>0.998632</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>88150.776787</td>\n",
       "      <td>0</td>\n",
       "      <td>0.459705</td>\n",
       "      <td>0.337051</td>\n",
       "      <td>0.186147</td>\n",
       "      <td>88150.776787-1</td>\n",
       "      <td>-142.869866</td>\n",
       "      <td>154.788121</td>\n",
       "      <td>684.981621</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.141761</td>\n",
       "      <td>0.192518</td>\n",
       "      <td>0.971000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>88150.779709</td>\n",
       "      <td>0</td>\n",
       "      <td>0.888789</td>\n",
       "      <td>0.543140</td>\n",
       "      <td>0.410668</td>\n",
       "      <td>88150.779709-0</td>\n",
       "      <td>38.942051</td>\n",
       "      <td>45.359863</td>\n",
       "      <td>705.232112</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.026087</td>\n",
       "      <td>0.041811</td>\n",
       "      <td>0.998785</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>88150.779759</td>\n",
       "      <td>0</td>\n",
       "      <td>0.550258</td>\n",
       "      <td>0.337923</td>\n",
       "      <td>0.173301</td>\n",
       "      <td>88150.779759-1</td>\n",
       "      <td>-141.879169</td>\n",
       "      <td>160.867779</td>\n",
       "      <td>683.893108</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.140397</td>\n",
       "      <td>0.200891</td>\n",
       "      <td>0.969501</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>88150.787485</td>\n",
       "      <td>1</td>\n",
       "      <td>0.502595</td>\n",
       "      <td>0.340109</td>\n",
       "      <td>0.142989</td>\n",
       "      <td>88150.787485-1</td>\n",
       "      <td>-139.404860</td>\n",
       "      <td>175.088321</td>\n",
       "      <td>681.151453</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.136989</td>\n",
       "      <td>0.220475</td>\n",
       "      <td>0.965725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125259</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125260</th>\n",
       "      <td>88443.697570</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125261</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125262</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125263</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>125264 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "0         88150.776780            0    0.828006    0.531433    0.397509   \n",
       "1         88150.776787            0    0.459705    0.337051    0.186147   \n",
       "2         88150.779709            0    0.888789    0.543140    0.410668   \n",
       "3         88150.779759            0    0.550258    0.337923    0.173301   \n",
       "4         88150.787485            1    0.502595    0.340109    0.142989   \n",
       "...                ...          ...         ...         ...         ...   \n",
       "125259    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "125260    88443.697570         8788    0.948733    0.407552    0.414731   \n",
       "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "125263    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "0                            88150.77678-0        28.369753        52.033135   \n",
       "1                           88150.776787-1      -142.869866       154.788121   \n",
       "2                           88150.779709-0        38.942051        45.359863   \n",
       "3                           88150.779759-1      -141.879169       160.867779   \n",
       "4                           88150.787485-1      -139.404860       175.088321   \n",
       "...                                    ...              ...              ...   \n",
       "125259        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "125263  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "0            705.121116         20.000000  ...        -20.000000   \n",
       "1            684.981621        -39.934928  ...        -20.075283   \n",
       "2            705.232112         20.000000  ...        -20.000000   \n",
       "3            683.893108        -39.934928  ...        -20.075283   \n",
       "4            681.151453        -39.934928  ...        -20.075283   \n",
       "...                 ...               ...  ...               ...   \n",
       "125259     -2777.243340         19.888755  ...        -20.707271   \n",
       "125260     -2628.637408         19.888755  ...        -20.707271   \n",
       "125261     -2647.420719         19.888755  ...        -20.707271   \n",
       "125262     -2499.428189         19.888755  ...        -20.707271   \n",
       "125263     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "0             0.011527        0.051002        0.998632               NaN   \n",
       "1            -0.141761        0.192518        0.971000               NaN   \n",
       "2             0.026087        0.041811        0.998785               NaN   \n",
       "3            -0.140397        0.200891        0.969501               NaN   \n",
       "4            -0.136989        0.220475        0.965725               NaN   \n",
       "...                ...             ...             ...               ...   \n",
       "125259       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125263       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "0                    NaN               NaN             NaN             NaN   \n",
       "1                    NaN               NaN             NaN             NaN   \n",
       "2                    NaN               NaN             NaN             NaN   \n",
       "3                    NaN               NaN             NaN             NaN   \n",
       "4                    NaN               NaN             NaN             NaN   \n",
       "...                  ...               ...             ...             ...   \n",
       "125259         14.763454        -23.294339       -0.130868        0.093021   \n",
       "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
       "125263         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "        gaze_normal1_z  \n",
       "0                  NaN  \n",
       "1                  NaN  \n",
       "2                  NaN  \n",
       "3                  NaN  \n",
       "4                  NaN  \n",
       "...                ...  \n",
       "125259        0.987026  \n",
       "125260        0.986979  \n",
       "125261        0.986979  \n",
       "125262        0.986827  \n",
       "125263        0.986974  \n",
       "\n",
       "[125264 rows x 21 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "data = pd.read_csv('C:\\\\Users\\\\华为\\\\Desktop\\\\gaze.csv')\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5ebeba0d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>88150.825638</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>88150.827729</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>88150.829663</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>88150.866015</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>88150.869620</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125259</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125260</th>\n",
       "      <td>88443.697570</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125261</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125262</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125263</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>87442 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "21        88150.825638            2    0.915197    0.493612    0.398950   \n",
       "22        88150.827729            2    0.915197    0.493561    0.399305   \n",
       "23        88150.829663            2    0.915197    0.493570    0.399542   \n",
       "39        88150.866015            3    0.922197    0.492592    0.398705   \n",
       "40        88150.869620            3    0.922197    0.492635    0.398814   \n",
       "...                ...          ...         ...         ...         ...   \n",
       "125259    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "125260    88443.697570         8788    0.948733    0.407552    0.414731   \n",
       "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "125263    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "21           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "22           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "23      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "39      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "40           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                    ...              ...              ...   \n",
       "125259        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "125263  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "21          -295.071057         20.000000  ...        -20.000000   \n",
       "22          -294.819200         20.000000  ...        -20.000000   \n",
       "23          -294.874516         20.000000  ...        -20.000000   \n",
       "39          -298.233245         20.000000  ...        -20.000000   \n",
       "40          -298.471253         20.000000  ...        -20.000000   \n",
       "...                 ...               ...  ...               ...   \n",
       "125259     -2777.243340         19.888755  ...        -20.707271   \n",
       "125260     -2628.637408         19.888755  ...        -20.707271   \n",
       "125261     -2647.420719         19.888755  ...        -20.707271   \n",
       "125262     -2499.428189         19.888755  ...        -20.707271   \n",
       "125263     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "21            0.062883        0.025100        0.997705        -39.934928   \n",
       "22            0.062883        0.025100        0.997705        -39.934928   \n",
       "23            0.062883        0.025100        0.997705        -39.934928   \n",
       "39            0.060717        0.025220        0.997836        -39.934928   \n",
       "40            0.060717        0.025220        0.997836        -39.934928   \n",
       "...                ...             ...             ...               ...   \n",
       "125259       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125263       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "21             14.997919        -20.075283       -0.150041        0.234536   \n",
       "22             14.997919        -20.075283       -0.150243        0.234115   \n",
       "23             14.997919        -20.075283       -0.150210        0.233747   \n",
       "39             14.997919        -20.075283       -0.149814        0.233510   \n",
       "40             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                  ...               ...             ...             ...   \n",
       "125259         14.763454        -23.294339       -0.130868        0.093021   \n",
       "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
       "125263         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "        gaze_normal1_z  \n",
       "21            0.960458  \n",
       "22            0.960530  \n",
       "23            0.960624  \n",
       "39            0.960744  \n",
       "40            0.960831  \n",
       "...                ...  \n",
       "125259        0.987026  \n",
       "125260        0.986979  \n",
       "125261        0.986979  \n",
       "125262        0.986827  \n",
       "125263        0.986974  \n",
       "\n",
       "[87442 rows x 21 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result1=data.loc[data['confidence']>=0.9]\n",
    "result1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5a6f44b6",
   "metadata": {},
   "outputs": [],
   "source": [
    "#2 根据正态分布筛选有效值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "9897d945",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>88150.825638</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>88150.827729</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>88150.829663</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>88150.866015</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>88150.869620</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86180</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86181</th>\n",
       "      <td>88443.697570</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86182</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86183</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86184</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86185 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "0        88150.825638            2    0.915197    0.493612    0.398950   \n",
       "1        88150.827729            2    0.915197    0.493561    0.399305   \n",
       "2        88150.829663            2    0.915197    0.493570    0.399542   \n",
       "3        88150.866015            3    0.922197    0.492592    0.398705   \n",
       "4        88150.869620            3    0.922197    0.492635    0.398814   \n",
       "...               ...          ...         ...         ...         ...   \n",
       "86180    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "86181    88443.697570         8788    0.948733    0.407552    0.414731   \n",
       "86182    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "86183    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "86184    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "0           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "1           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "2      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "3      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "4           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                   ...              ...              ...   \n",
       "86180        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "86181   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "86182  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "86183       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "86184  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "       gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "0          -295.071057         20.000000  ...        -20.000000   \n",
       "1          -294.819200         20.000000  ...        -20.000000   \n",
       "2          -294.874516         20.000000  ...        -20.000000   \n",
       "3          -298.233245         20.000000  ...        -20.000000   \n",
       "4          -298.471253         20.000000  ...        -20.000000   \n",
       "...                ...               ...  ...               ...   \n",
       "86180     -2777.243340         19.888755  ...        -20.707271   \n",
       "86181     -2628.637408         19.888755  ...        -20.707271   \n",
       "86182     -2647.420719         19.888755  ...        -20.707271   \n",
       "86183     -2499.428189         19.888755  ...        -20.707271   \n",
       "86184     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "       gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "0            0.062883        0.025100        0.997705        -39.934928   \n",
       "1            0.062883        0.025100        0.997705        -39.934928   \n",
       "2            0.062883        0.025100        0.997705        -39.934928   \n",
       "3            0.060717        0.025220        0.997836        -39.934928   \n",
       "4            0.060717        0.025220        0.997836        -39.934928   \n",
       "...               ...             ...             ...               ...   \n",
       "86180       -0.110854        0.041843        0.992955        -37.372594   \n",
       "86181       -0.110854        0.041843        0.992955        -37.372594   \n",
       "86182       -0.111009        0.041794        0.992940        -37.372594   \n",
       "86183       -0.111009        0.041794        0.992940        -37.372594   \n",
       "86184       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "       eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "0             14.997919        -20.075283       -0.150041        0.234536   \n",
       "1             14.997919        -20.075283       -0.150243        0.234115   \n",
       "2             14.997919        -20.075283       -0.150210        0.233747   \n",
       "3             14.997919        -20.075283       -0.149814        0.233510   \n",
       "4             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                 ...               ...             ...             ...   \n",
       "86180         14.763454        -23.294339       -0.130868        0.093021   \n",
       "86181         14.763454        -23.294339       -0.132037        0.091860   \n",
       "86182         14.763454        -23.294339       -0.132037        0.091860   \n",
       "86183         14.763454        -23.294339       -0.133311        0.091656   \n",
       "86184         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "       gaze_normal1_z  \n",
       "0            0.960458  \n",
       "1            0.960530  \n",
       "2            0.960624  \n",
       "3            0.960744  \n",
       "4            0.960831  \n",
       "...               ...  \n",
       "86180        0.987026  \n",
       "86181        0.986979  \n",
       "86182        0.986979  \n",
       "86183        0.986827  \n",
       "86184        0.986974  \n",
       "\n",
       "[86185 rows x 21 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean1=result1['norm_pos_x'].mean()\n",
    "mean2=result1['norm_pos_y'].mean()\n",
    "std1=result1['norm_pos_x'].std()\n",
    "std2=result1['norm_pos_y'].std()\n",
    "\n",
    "result2=result1.loc[result1['norm_pos_x']<mean1+3*std1]\n",
    "result3=result2.loc[result2['norm_pos_x']>mean1-3*std1]\n",
    "result4=result3.loc[result3['norm_pos_y']<mean2+3*std2]\n",
    "result5=result4.loc[result4['norm_pos_y']>mean2-3*std2]\n",
    "x=result5.reset_index(drop=True)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "8d2c1ced",
   "metadata": {},
   "outputs": [],
   "source": [
    "x.to_csv('C:\\\\Users\\\\华为\\\\Desktop\\\\new_data.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "db17b1a6",
   "metadata": {},
   "outputs": [],
   "source": [
    "#3 时间戳转化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e7c1640f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1970-01-01 00:00:00.000088150</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1970-01-01 00:00:00.000088150</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1970-01-01 00:00:00.000088150</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1970-01-01 00:00:00.000088150</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1970-01-01 00:00:00.000088150</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86180</th>\n",
       "      <td>1970-01-01 00:00:00.000088443</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86181</th>\n",
       "      <td>1970-01-01 00:00:00.000088443</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86182</th>\n",
       "      <td>1970-01-01 00:00:00.000088443</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86183</th>\n",
       "      <td>1970-01-01 00:00:00.000088443</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86184</th>\n",
       "      <td>1970-01-01 00:00:00.000088443</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86185 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                     gaze_timestamp  world_index  confidence  norm_pos_x  \\\n",
       "0     1970-01-01 00:00:00.000088150            2    0.915197    0.493612   \n",
       "1     1970-01-01 00:00:00.000088150            2    0.915197    0.493561   \n",
       "2     1970-01-01 00:00:00.000088150            2    0.915197    0.493570   \n",
       "3     1970-01-01 00:00:00.000088150            3    0.922197    0.492592   \n",
       "4     1970-01-01 00:00:00.000088150            3    0.922197    0.492635   \n",
       "...                             ...          ...         ...         ...   \n",
       "86180 1970-01-01 00:00:00.000088443         8788    0.995336    0.407831   \n",
       "86181 1970-01-01 00:00:00.000088443         8788    0.948733    0.407552   \n",
       "86182 1970-01-01 00:00:00.000088443         8788    0.945284    0.407467   \n",
       "86183 1970-01-01 00:00:00.000088443         8788    0.945284    0.407160   \n",
       "86184 1970-01-01 00:00:00.000088443         8788    0.945284    0.407637   \n",
       "\n",
       "       norm_pos_y                           base_data  gaze_point_3d_x  \\\n",
       "0        0.398950       88150.827729-0 88150.823548-1         2.412810   \n",
       "1        0.399305       88150.827729-0 88150.827729-1         2.429837   \n",
       "2        0.399542  88150.827729-0 88150.83159799999-1         2.427118   \n",
       "3        0.398705  88150.867514-0 88150.86451599999-1         2.827911   \n",
       "4        0.398814       88150.867514-0 88150.871726-1         2.813774   \n",
       "...           ...                                 ...              ...   \n",
       "86180    0.413470        88443.69561-0 88443.695591-1       327.648915   \n",
       "86181    0.414731   88443.69561-0 88443.69953099999-1       311.054477   \n",
       "86182    0.414705  88443.703629-0 88443.69953099999-1       313.566509   \n",
       "86183    0.415340       88443.703629-0 88443.703587-1       297.019831   \n",
       "86184    0.413674  88443.703629-0 88443.70751899999-1       323.629974   \n",
       "\n",
       "       gaze_point_3d_y  gaze_point_3d_z  eye_center0_3d_x  ...  \\\n",
       "0           -21.468145      -295.071057         20.000000  ...   \n",
       "1           -21.374413      -294.819200         20.000000  ...   \n",
       "2           -21.328193      -294.874516         20.000000  ...   \n",
       "3           -21.750938      -298.233245         20.000000  ...   \n",
       "4           -21.744854      -298.471253         20.000000  ...   \n",
       "...                ...              ...               ...  ...   \n",
       "86180      -173.027524     -2777.243340         19.888755  ...   \n",
       "86181      -161.381388     -2628.637408         19.888755  ...   \n",
       "86182      -162.585330     -2647.420719         19.888755  ...   \n",
       "86183      -152.352987     -2499.428189         19.888755  ...   \n",
       "86184      -170.142461     -2737.404466         19.888755  ...   \n",
       "\n",
       "       eye_center0_3d_z  gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  \\\n",
       "0            -20.000000        0.062883        0.025100        0.997705   \n",
       "1            -20.000000        0.062883        0.025100        0.997705   \n",
       "2            -20.000000        0.062883        0.025100        0.997705   \n",
       "3            -20.000000        0.060717        0.025220        0.997836   \n",
       "4            -20.000000        0.060717        0.025220        0.997836   \n",
       "...                 ...             ...             ...             ...   \n",
       "86180        -20.707271       -0.110854        0.041843        0.992955   \n",
       "86181        -20.707271       -0.110854        0.041843        0.992955   \n",
       "86182        -20.707271       -0.111009        0.041794        0.992940   \n",
       "86183        -20.707271       -0.111009        0.041794        0.992940   \n",
       "86184        -20.707271       -0.111009        0.041794        0.992940   \n",
       "\n",
       "       eye_center1_3d_x  eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  \\\n",
       "0            -39.934928         14.997919        -20.075283       -0.150041   \n",
       "1            -39.934928         14.997919        -20.075283       -0.150243   \n",
       "2            -39.934928         14.997919        -20.075283       -0.150210   \n",
       "3            -39.934928         14.997919        -20.075283       -0.149814   \n",
       "4            -39.934928         14.997919        -20.075283       -0.149645   \n",
       "...                 ...               ...               ...             ...   \n",
       "86180        -37.372594         14.763454        -23.294339       -0.130868   \n",
       "86181        -37.372594         14.763454        -23.294339       -0.132037   \n",
       "86182        -37.372594         14.763454        -23.294339       -0.132037   \n",
       "86183        -37.372594         14.763454        -23.294339       -0.133311   \n",
       "86184        -37.372594         14.763454        -23.294339       -0.131320   \n",
       "\n",
       "       gaze_normal1_y  gaze_normal1_z  \n",
       "0            0.234536        0.960458  \n",
       "1            0.234115        0.960530  \n",
       "2            0.233747        0.960624  \n",
       "3            0.233510        0.960744  \n",
       "4            0.233258        0.960831  \n",
       "...               ...             ...  \n",
       "86180        0.093021        0.987026  \n",
       "86181        0.091860        0.986979  \n",
       "86182        0.091860        0.986979  \n",
       "86183        0.091656        0.986827  \n",
       "86184        0.092941        0.986974  \n",
       "\n",
       "[86185 rows x 21 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2 = x.copy()\n",
    "x2.loc[:,'gaze_timestamp'] = pd.to_datetime(x2.loc[:,'gaze_timestamp'])\n",
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d66adf39",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "#4 计算采样率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b41fd508",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "427.62610766083765\n"
     ]
    }
   ],
   "source": [
    "number = len(data)\n",
    "time1 = data['gaze_timestamp'][0]\n",
    "time2 = data['gaze_timestamp'][125263]\n",
    "rate = number / (time2 - time1)\n",
    "print(rate)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "98650b0f",
   "metadata": {},
   "outputs": [],
   "source": [
    "#5 二次筛选"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "72c8b16c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[gaze_timestamp        88150.77678\n",
      "world_index                     0\n",
      "confidence               0.828006\n",
      "norm_pos_x               0.531433\n",
      "norm_pos_y               0.397509\n",
      "base_data           88150.77678-0\n",
      "gaze_point_3d_x         28.369753\n",
      "gaze_point_3d_y         52.033135\n",
      "gaze_point_3d_z        705.121116\n",
      "eye_center0_3d_x             20.0\n",
      "eye_center0_3d_y             15.0\n",
      "eye_center0_3d_z            -20.0\n",
      "gaze_normal0_x           0.011527\n",
      "gaze_normal0_y           0.051002\n",
      "gaze_normal0_z           0.998632\n",
      "eye_center1_3d_x              NaN\n",
      "eye_center1_3d_y              NaN\n",
      "eye_center1_3d_z              NaN\n",
      "gaze_normal1_x                NaN\n",
      "gaze_normal1_y                NaN\n",
      "gaze_normal1_z                NaN\n",
      "Name: 0, dtype: object, gaze_timestamp        88150.787485\n",
      "world_index                      1\n",
      "confidence                0.502595\n",
      "norm_pos_x                0.340109\n",
      "norm_pos_y                0.142989\n",
      "base_data           88150.787485-1\n",
      "gaze_point_3d_x         -139.40486\n",
      "gaze_point_3d_y         175.088321\n",
      "gaze_point_3d_z         681.151453\n",
      "eye_center0_3d_x        -39.934928\n",
      "eye_center0_3d_y         14.997919\n",
      "eye_center0_3d_z        -20.075283\n",
      "gaze_normal0_x           -0.136989\n",
      "gaze_normal0_y            0.220475\n",
      "gaze_normal0_z            0.965725\n",
      "eye_center1_3d_x               NaN\n",
      "eye_center1_3d_y               NaN\n",
      "eye_center1_3d_z               NaN\n",
      "gaze_normal1_x                 NaN\n",
      "gaze_normal1_y                 NaN\n",
      "gaze_normal1_z                 NaN\n",
      "Name: 4, dtype: object, gaze_timestamp                      88150.798406\n",
      "world_index                                    1\n",
      "confidence                              0.708476\n",
      "norm_pos_x                              0.494116\n",
      "norm_pos_y                              0.407109\n",
      "base_data           88150.79569-0 88150.801123-1\n",
      "gaze_point_3d_x                         2.179629\n",
      "gaze_point_3d_y                        -19.35453\n",
      "gaze_point_3d_z                      -289.386597\n",
      "eye_center0_3d_x                            20.0\n",
      "eye_center0_3d_y                            15.0\n",
      "eye_center0_3d_z                           -20.0\n",
      "gaze_normal0_x                          0.065145\n",
      "gaze_normal0_y                          0.027374\n",
      "gaze_normal0_z                            0.9975\n",
      "eye_center1_3d_x                      -39.934928\n",
      "eye_center1_3d_y                       14.997919\n",
      "eye_center1_3d_z                      -20.075283\n",
      "gaze_normal1_x                         -0.152523\n",
      "gaze_normal1_y                          0.222659\n",
      "gaze_normal1_z                          0.962891\n",
      "Name: 9, dtype: object, gaze_timestamp                      88150.807269\n",
      "world_index                                    1\n",
      "confidence                              0.856341\n",
      "norm_pos_x                              0.494777\n",
      "norm_pos_y                              0.404969\n",
      "base_data           88150.809749-0 88150.80479-1\n",
      "gaze_point_3d_x                         1.925755\n",
      "gaze_point_3d_y                       -19.710658\n",
      "gaze_point_3d_z                      -288.072115\n",
      "eye_center0_3d_x                            20.0\n",
      "eye_center0_3d_y                            15.0\n",
      "eye_center0_3d_z                           -20.0\n",
      "gaze_normal0_x                          0.066338\n",
      "gaze_normal0_y                           0.02384\n",
      "gaze_normal0_z                          0.997512\n",
      "eye_center1_3d_x                      -39.934928\n",
      "eye_center1_3d_y                       14.997919\n",
      "eye_center1_3d_z                      -20.075283\n",
      "gaze_normal1_x                         -0.152228\n",
      "gaze_normal1_y                          0.229814\n",
      "gaze_normal1_z                          0.961255\n",
      "Name: 13, dtype: object, gaze_timestamp                            88150.818051\n",
      "world_index                                          2\n",
      "confidence                                    0.836166\n",
      "norm_pos_x                                    0.493772\n",
      "norm_pos_y                                     0.40027\n",
      "base_data           88150.81599799999-0 88150.820104-1\n",
      "gaze_point_3d_x                               2.325815\n",
      "gaze_point_3d_y                             -20.950335\n",
      "gaze_point_3d_z                            -291.765325\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                0.063962\n",
      "gaze_normal0_y                                0.024893\n",
      "gaze_normal0_z                                0.997642\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.151527\n",
      "gaze_normal1_y                                0.234143\n",
      "gaze_normal1_z                                0.960321\n",
      "Name: 18, dtype: object, gaze_timestamp                       88150.827729\n",
      "world_index                                     2\n",
      "confidence                               0.915197\n",
      "norm_pos_x                               0.493561\n",
      "norm_pos_y                               0.399305\n",
      "base_data           88150.827729-0 88150.827729-1\n",
      "gaze_point_3d_x                          2.429837\n",
      "gaze_point_3d_y                        -21.374413\n",
      "gaze_point_3d_z                         -294.8192\n",
      "eye_center0_3d_x                             20.0\n",
      "eye_center0_3d_y                             15.0\n",
      "eye_center0_3d_z                            -20.0\n",
      "gaze_normal0_x                           0.062883\n",
      "gaze_normal0_y                             0.0251\n",
      "gaze_normal0_z                           0.997705\n",
      "eye_center1_3d_x                       -39.934928\n",
      "eye_center1_3d_y                        14.997919\n",
      "eye_center1_3d_z                       -20.075283\n",
      "gaze_normal1_x                          -0.150243\n",
      "gaze_normal1_y                           0.234115\n",
      "gaze_normal1_z                            0.96053\n",
      "Name: 22, dtype: object, gaze_timestamp                                 88150.839575\n",
      "world_index                                               2\n",
      "confidence                                         0.898123\n",
      "norm_pos_x                                         0.493449\n",
      "norm_pos_y                                         0.398484\n",
      "base_data           88150.83570099999-0 88150.84344899999-1\n",
      "gaze_point_3d_x                                    2.469473\n",
      "gaze_point_3d_y                                  -21.525123\n",
      "gaze_point_3d_z                                 -294.494617\n",
      "eye_center0_3d_x                                       20.0\n",
      "eye_center0_3d_y                                       15.0\n",
      "eye_center0_3d_z                                      -20.0\n",
      "gaze_normal0_x                                     0.062819\n",
      "gaze_normal0_y                                     0.027157\n",
      "gaze_normal0_z                                     0.997655\n",
      "eye_center1_3d_x                                 -39.934928\n",
      "eye_center1_3d_y                                  14.997919\n",
      "eye_center1_3d_z                                 -20.075283\n",
      "gaze_normal1_x                                    -0.150562\n",
      "gaze_normal1_y                                     0.233448\n",
      "gaze_normal1_z                                     0.960642\n",
      "Name: 27, dtype: object, gaze_timestamp                            88150.849505\n",
      "world_index                                          3\n",
      "confidence                                    0.814635\n",
      "norm_pos_x                                    0.492453\n",
      "norm_pos_y                                    0.398923\n",
      "base_data           88150.85153599999-0 88150.847474-1\n",
      "gaze_point_3d_x                               2.852103\n",
      "gaze_point_3d_y                             -21.486779\n",
      "gaze_point_3d_z                            -295.248611\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                0.061283\n",
      "gaze_normal0_y                                0.025669\n",
      "gaze_normal0_z                                 0.99779\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.151476\n",
      "gaze_normal1_y                                0.233933\n",
      "gaze_normal1_z                                 0.96038\n",
      "Name: 31, dtype: object, gaze_timestamp                                 88150.859561\n",
      "world_index                                               3\n",
      "confidence                                         0.832982\n",
      "norm_pos_x                                         0.493051\n",
      "norm_pos_y                                         0.397208\n",
      "base_data           88150.85955699999-0 88150.85956499999-1\n",
      "gaze_point_3d_x                                     2.65359\n",
      "gaze_point_3d_y                                  -22.079776\n",
      "gaze_point_3d_z                                 -298.333582\n",
      "eye_center0_3d_x                                       20.0\n",
      "eye_center0_3d_y                                       15.0\n",
      "eye_center0_3d_z                                      -20.0\n",
      "gaze_normal0_x                                     0.061304\n",
      "gaze_normal0_y                                     0.026883\n",
      "gaze_normal0_z                                     0.997757\n",
      "eye_center1_3d_x                                 -39.934928\n",
      "eye_center1_3d_y                                  14.997919\n",
      "eye_center1_3d_z                                 -20.075283\n",
      "gaze_normal1_x                                    -0.149152\n",
      "gaze_normal1_y                                     0.234053\n",
      "gaze_normal1_z                                     0.960715\n",
      "Name: 36, dtype: object, gaze_timestamp                        88150.86962\n",
      "world_index                                     3\n",
      "confidence                               0.922197\n",
      "norm_pos_x                               0.492635\n",
      "norm_pos_y                               0.398814\n",
      "base_data           88150.867514-0 88150.871726-1\n",
      "gaze_point_3d_x                          2.813774\n",
      "gaze_point_3d_y                        -21.744854\n",
      "gaze_point_3d_z                       -298.471253\n",
      "eye_center0_3d_x                             20.0\n",
      "eye_center0_3d_y                             15.0\n",
      "eye_center0_3d_z                            -20.0\n",
      "gaze_normal0_x                           0.060717\n",
      "gaze_normal0_y                            0.02522\n",
      "gaze_normal0_z                           0.997836\n",
      "eye_center1_3d_x                       -39.934928\n",
      "eye_center1_3d_y                        14.997919\n",
      "eye_center1_3d_z                       -20.075283\n",
      "gaze_normal1_x                          -0.149645\n",
      "gaze_normal1_y                           0.233258\n",
      "gaze_normal1_z                           0.960831\n",
      "Name: 40, dtype: object, gaze_timestamp                            88150.879584\n",
      "world_index                                          4\n",
      "confidence                                       0.945\n",
      "norm_pos_x                                    0.492159\n",
      "norm_pos_y                                    0.398855\n",
      "base_data           88150.879586-0 88150.87958299999-1\n",
      "gaze_point_3d_x                               2.996872\n",
      "gaze_point_3d_y                             -21.746449\n",
      "gaze_point_3d_z                            -298.615702\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                 0.06004\n",
      "gaze_normal0_y                                0.024936\n",
      "gaze_normal0_z                                0.997884\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.150193\n",
      "gaze_normal1_y                                0.233409\n",
      "gaze_normal1_z                                0.960709\n",
      "Name: 44, dtype: object, gaze_timestamp                       88150.889996\n",
      "world_index                                     4\n",
      "confidence                               0.825607\n",
      "norm_pos_x                               0.492182\n",
      "norm_pos_y                                 0.3974\n",
      "base_data           88150.888291-0 88150.891702-1\n",
      "gaze_point_3d_x                          3.013483\n",
      "gaze_point_3d_y                        -22.246902\n",
      "gaze_point_3d_z                       -301.155509\n",
      "eye_center0_3d_x                             20.0\n",
      "eye_center0_3d_y                             15.0\n",
      "eye_center0_3d_z                            -20.0\n",
      "gaze_normal0_x                           0.059439\n",
      "gaze_normal0_y                           0.025782\n",
      "gaze_normal0_z                           0.997899\n",
      "eye_center1_3d_x                       -39.934928\n",
      "eye_center1_3d_y                        14.997919\n",
      "eye_center1_3d_z                       -20.075283\n",
      "gaze_normal1_x                          -0.148916\n",
      "gaze_normal1_y                           0.233733\n",
      "gaze_normal1_z                           0.960829\n",
      "Name: 49, dtype: object, gaze_timestamp                            88150.899511\n",
      "world_index                                          4\n",
      "confidence                                    0.821103\n",
      "norm_pos_x                                     0.49126\n",
      "norm_pos_y                                    0.398452\n",
      "base_data           88150.89951199999-0 88150.899511-1\n",
      "gaze_point_3d_x                               3.355394\n",
      "gaze_point_3d_y                             -21.929324\n",
      "gaze_point_3d_z                            -299.930569\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                0.058504\n",
      "gaze_normal0_y                                0.025053\n",
      "gaze_normal0_z                                0.997973\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.150724\n",
      "gaze_normal1_y                                0.233361\n",
      "gaze_normal1_z                                0.960638\n",
      "Name: 53, dtype: object, gaze_timestamp                                 88150.909398\n",
      "world_index                                               4\n",
      "confidence                                         0.860093\n",
      "norm_pos_x                                           0.4915\n",
      "norm_pos_y                                          0.39843\n",
      "base_data           88150.90741599999-0 88150.91137999999-1\n",
      "gaze_point_3d_x                                     3.28235\n",
      "gaze_point_3d_y                                  -22.061576\n",
      "gaze_point_3d_z                                  -301.67539\n",
      "eye_center0_3d_x                                       20.0\n",
      "eye_center0_3d_y                                       15.0\n",
      "eye_center0_3d_z                                      -20.0\n",
      "gaze_normal0_x                                     0.058395\n",
      "gaze_normal0_y                                        0.024\n",
      "gaze_normal0_z                                     0.998005\n",
      "eye_center1_3d_x                                 -39.934928\n",
      "eye_center1_3d_y                                  14.997919\n",
      "eye_center1_3d_z                                 -20.075283\n",
      "gaze_normal1_x                                    -0.149559\n",
      "gaze_normal1_y                                     0.233748\n",
      "gaze_normal1_z                                     0.960726\n",
      "Name: 57, dtype: object, gaze_timestamp                            88150.919423\n",
      "world_index                                          5\n",
      "confidence                                    0.856588\n",
      "norm_pos_x                                    0.491391\n",
      "norm_pos_y                                    0.396667\n",
      "base_data           88150.91942399999-0 88150.919423-1\n",
      "gaze_point_3d_x                               3.336275\n",
      "gaze_point_3d_y                             -22.524998\n",
      "gaze_point_3d_z                             -302.75705\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                0.057982\n",
      "gaze_normal0_y                                0.026013\n",
      "gaze_normal0_z                                0.997979\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.149174\n",
      "gaze_normal1_y                                0.233957\n",
      "gaze_normal1_z                                0.960735\n",
      "Name: 62, dtype: object, gaze_timestamp                            88150.927525\n",
      "world_index                                          5\n",
      "confidence                                    0.853041\n",
      "norm_pos_x                                    0.491452\n",
      "norm_pos_y                                    0.397485\n",
      "base_data           88150.927522-0 88150.92752699999-1\n",
      "gaze_point_3d_x                               3.323771\n",
      "gaze_point_3d_y                             -22.422425\n",
      "gaze_point_3d_z                            -303.781499\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                0.057815\n",
      "gaze_normal0_y                                0.023935\n",
      "gaze_normal0_z                                 0.99804\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.148602\n",
      "gaze_normal1_y                                0.234394\n",
      "gaze_normal1_z                                0.960717\n",
      "Name: 65, dtype: object, gaze_timestamp                                 88150.938559\n",
      "world_index                                               5\n",
      "confidence                                         0.998744\n",
      "norm_pos_x                                         0.491162\n",
      "norm_pos_y                                         0.396321\n",
      "base_data           88150.93622799999-0 88150.94089099999-1\n",
      "gaze_point_3d_x                                    3.444671\n",
      "gaze_point_3d_y                                  -22.729378\n",
      "gaze_point_3d_z                                 -304.484514\n",
      "eye_center0_3d_x                                       20.0\n",
      "eye_center0_3d_y                                       15.0\n",
      "eye_center0_3d_z                                      -20.0\n",
      "gaze_normal0_x                                     0.057256\n",
      "gaze_normal0_y                                     0.025568\n",
      "gaze_normal0_z                                     0.998032\n",
      "eye_center1_3d_x                                 -39.934928\n",
      "eye_center1_3d_y                                  14.997919\n",
      "eye_center1_3d_z                                 -20.075283\n",
      "gaze_normal1_x                                    -0.148648\n",
      "gaze_normal1_y                                      0.23424\n",
      "gaze_normal1_z                                     0.960747\n",
      "Name: 69, dtype: object, gaze_timestamp                       88150.947523\n",
      "world_index                                     6\n",
      "confidence                               0.803616\n",
      "norm_pos_x                               0.491624\n",
      "norm_pos_y                               0.396118\n",
      "base_data           88150.947523-0 88150.947523-1\n",
      "gaze_point_3d_x                          3.262791\n",
      "gaze_point_3d_y                        -22.761999\n",
      "gaze_point_3d_z                       -304.324652\n",
      "eye_center0_3d_x                             20.0\n",
      "eye_center0_3d_y                             15.0\n",
      "eye_center0_3d_z                            -20.0\n",
      "gaze_normal0_x                           0.057914\n",
      "gaze_normal0_y                           0.025849\n",
      "gaze_normal0_z                           0.997987\n",
      "eye_center1_3d_x                       -39.934928\n",
      "eye_center1_3d_y                        14.997919\n",
      "eye_center1_3d_z                       -20.075283\n",
      "gaze_normal1_x                          -0.148117\n",
      "gaze_normal1_y                           0.234331\n",
      "gaze_normal1_z                           0.960807\n",
      "Name: 74, dtype: object, gaze_timestamp                            88150.959502\n",
      "world_index                                          6\n",
      "confidence                                    0.839119\n",
      "norm_pos_x                                    0.491028\n",
      "norm_pos_y                                    0.397471\n",
      "base_data           88150.963521-0 88150.95548399999-1\n",
      "gaze_point_3d_x                               3.496927\n",
      "gaze_point_3d_y                             -22.477999\n",
      "gaze_point_3d_z                            -304.492535\n",
      "eye_center0_3d_x                                  20.0\n",
      "eye_center0_3d_y                                  15.0\n",
      "eye_center0_3d_z                                 -20.0\n",
      "gaze_normal0_x                                0.057075\n",
      "gaze_normal0_y                                0.023795\n",
      "gaze_normal0_z                                0.998086\n",
      "eye_center1_3d_x                            -39.934928\n",
      "eye_center1_3d_y                             14.997919\n",
      "eye_center1_3d_z                            -20.075283\n",
      "gaze_normal1_x                               -0.148821\n",
      "gaze_normal1_y                                0.234277\n",
      "gaze_normal1_z                                0.960712\n",
      "Name: 78, dtype: object, gaze_timestamp                           88150.969507\n",
      "world_index                                         6\n",
      "confidence                                   0.892754\n",
      "norm_pos_x                                   0.490926\n",
      "norm_pos_y                                   0.396929\n",
      "base_data           88150.96744-0 88150.97157499999-1\n",
      "gaze_point_3d_x                               3.55408\n",
      "gaze_point_3d_y                             -22.70782\n",
      "gaze_point_3d_z                           -305.989272\n",
      "eye_center0_3d_x                                 20.0\n",
      "eye_center0_3d_y                                 15.0\n",
      "eye_center0_3d_z                                -20.0\n",
      "gaze_normal0_x                               0.056584\n",
      "gaze_normal0_y                               0.024529\n",
      "gaze_normal0_z                               0.998096\n",
      "eye_center1_3d_x                           -39.934928\n",
      "eye_center1_3d_y                            14.997919\n",
      "eye_center1_3d_z                           -20.075283\n",
      "gaze_normal1_x                              -0.148257\n",
      "gaze_normal1_y                               0.233795\n",
      "gaze_normal1_z                               0.960916\n",
      "Name: 83, dtype: object]\n"
     ]
    }
   ],
   "source": [
    "re_data1 = data['gaze_timestamp'][0]\n",
    "re_data2 = []\n",
    "re_data2.append(data.iloc[0,:])\n",
    "i = 1\n",
    "fre = 0.01\n",
    "a = b = 1\n",
    "while len(re_data2) < 20 :\n",
    "    a = abs(float(data['gaze_timestamp'][i] - re_data1 - fre))\n",
    "    if a >= b:\n",
    "        a = 1\n",
    "        re_data2.append(data.iloc[i-1,:])\n",
    "        re_data1 = data['gaze_timestamp'][i-1]\n",
    "    i += 1\n",
    "    b = a\n",
    "print(re_data2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f30de862",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
